﻿using System;
using System.Runtime.InteropServices;
using System.ComponentModel;
using System.IO;
using System.Windows.Forms;
using Microsoft.MediaPlayer.Interop;
using BMproductions.Media.MediaPlayer.WMPPlus.Properties;

namespace BMproductions.Media.MediaPlayer.WMPPlus {
	public class WMPPlusBase: WMPPlugEvents {
		public WMPPlusSettings Settings { get; protected set; }
		public void DisplayPropertyPage(/*IntPtr hwndParent*/) {
			DisplayPropertyPage(/*hwndParent, */null);
		}

		public void DisplayPropertyPage(/*IntPtr hwndParent, */string page) {
			var core = this.core;
			if (core == null) {
				core = new WindowsMediaPlayerClass();
			}
			var settings = Settings;
			if (settings == null) {
				settings = new WMPPlusSettings();
			}
			Application.EnableVisualStyles();
			var form = new SettingsForm();
			form.Init(settings, core);
			form.SelectPage(page, false);
			form.ShowDialog(/*hwndParent*/);
		}
	}
}
